import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router';
// load module
import router from './router'
import store from './store'
import http from './http'
import api from './config/api'
// load i18n
import i18n from './i18n'
import './utils'
// load css
import 'animate.css'
//load uditor
import '../static/ueditor/ueditor.config.js'
import '../static/ueditor/ueditor.all.min.js'
import '../static/ueditor/lang/zh-cn/zh-cn.js'
import '../static/ueditor/ueditor.parse.js'

//load iview
import iView from 'iview';
import 'iview/dist/styles/iview.css';
Vue.use(VueRouter);
Vue.use(iView);

//load element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)


i18n.SetLocale('zhcn');

Vue.config.productionTip = false;
Vue.prototype.$http = http;
Vue.prototype.$api = api;

const vue = new Vue({
  router,
  store,
  template: '<App/>',
  components: {App}
});

//注册组件
// Vue.component('my-header',{
//   template: '<p>this is my header</p>',
// });

http.init(() => {
  vue.$mount("#app");
});
